How to use Script Parameters Editor

Click Run -> Edit Environment Variables, then click Parameters to open the Script Parameters Editor. Then enter name=value pairs separated by = (values will be urlencoded automatically). Here's the example:

name=DzSoft Perl Editor
email=support@dzsoft.com

The following example demonstrates now to use the parameters in your script:

#!/usr/bin/perl

use CGI qw(param);
my $name = param('name');

print "Content-type: text/html\n\n";
print "<html>Hello, $name!</html>\n";

To send the parameters to script when running on the server, use standard HTML forms.

If your script processes from input using some code like this:

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
        ($name, $value) = split(/=/, $pair);
        $value =~ tr/+/ /;
        $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
        $FORM{$name} = $value;
}

And you need to test it in DzSoft Perl Editor, please do the following:

  1. Replace in your script this:
      read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
    with this:
      if ($ENV{'REQUEST_METHOD'} =~ 'GET') {
        $buffer = $ENV{'QUERY_STRING'};
      } else {
        read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
      }
  2. Click Run -> Edit Environment Variables, then click Parameters and check the Link Query String to Script Parameters check box.
  3. Now you can manipulte the form data using the Script Parameters Editor.